<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
      <title>GTL - Graph Template Library: embedding.h Source File</title>
      <link href="doxygen.css" rel="stylesheet" type="text/css">
  </head>
  <body>
    <p class="links">  
      <a href="../index.html">Home</a> |
      Documentation |
      <a href="../register.html">Download</a> |
      <a href="../platforms.html">Platforms</a> |
      <a href="../refer.html">Projects</a> |      
      <a href="../lists.html">Mailing Lists</a> |
      <a href="../history.html">Version History</a>
    </p>

<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="classes.html"><span>Classes</span></a></li>
    <li class="current"><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<h1>embedding.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//==========================================================================</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">//   embedding.h</span>
<a name="l00004"></a>00004 <span class="comment">//</span>
<a name="l00005"></a>00005 <span class="comment">//==========================================================================</span>
<a name="l00006"></a>00006 <span class="comment">// $Id: embedding.h,v 1.20 2003/06/11 11:28:21 raitner Exp $</span>
<a name="l00007"></a>00007 
<a name="l00008"></a>00008 <span class="preprocessor">#ifndef __EMBEDDING__H</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define __EMBEDDING__H</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &lt;GTL/GTL.h&gt;</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;GTL/graph.h&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;GTL/st_number.h&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;GTL/symlist.h&gt;</span>
<a name="l00015"></a>00015 
<a name="l00016"></a>00016 __GTL_BEGIN_NAMESPACE
<a name="l00017"></a>00017 
<a name="l00028"></a><a class="code" href="a00022.html">00028</a> <span class="keyword">class </span>GTL_EXTERN <a class="code" href="a00022.html" title="Ordered adjacency lists as a result of planarity testing.">planar_embedding</a> 
<a name="l00029"></a>00029 {
<a name="l00030"></a>00030 <span class="keyword">public</span>:
<a name="l00034"></a>00034     <span class="keyword">typedef</span> <a class="code" href="a00027.html" title="List which can be reversed in .">symlist&lt;edge&gt;</a> <a class="code" href="a00027.html" title="List which can be reversed in .">adj_list</a>;
<a name="l00035"></a>00035 
<a name="l00039"></a>00039     <span class="keyword">typedef</span> <a class="code" href="a00027.html" title="List which can be reversed in .">symlist&lt;edge&gt;::iterator</a> iterator;
<a name="l00040"></a>00040 <span class="keyword">private</span>:
<a name="l00047"></a>00047     <a class="code" href="a00022.html" title="Ordered adjacency lists as a result of planarity testing.">planar_embedding</a>() : G(0)
<a name="l00048"></a>00048     {
<a name="l00049"></a>00049     }
<a name="l00050"></a>00050 <span class="keyword">public</span>:
<a name="l00057"></a>00057     <a class="code" href="a00022.html" title="Ordered adjacency lists as a result of planarity testing.">planar_embedding</a>(<span class="keyword">const</span> <a class="code" href="a00022.html" title="Ordered adjacency lists as a result of planarity testing.">planar_embedding</a>&amp; em);
<a name="l00058"></a>00058 
<a name="l00063"></a><a class="code" href="a00022.html#e5605eb5f21346f3f8194dd2db9de117">00063</a>     <span class="keyword">virtual</span> ~<a class="code" href="a00022.html" title="Ordered adjacency lists as a result of planarity testing.">planar_embedding</a>()
<a name="l00064"></a>00064     {
<a name="l00065"></a>00065     }
<a name="l00066"></a>00066 
<a name="l00076"></a>00076     <a class="code" href="a00022.html" title="Ordered adjacency lists as a result of planarity testing.">planar_embedding</a>&amp; operator=(<span class="keyword">const</span> <a class="code" href="a00022.html" title="Ordered adjacency lists as a result of planarity testing.">planar_embedding</a>&amp; em); 
<a name="l00077"></a>00077 <span class="keyword">private</span>:
<a name="l00084"></a>00084     <span class="keywordtype">void</span> init(<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G);
<a name="l00085"></a>00085 
<a name="l00092"></a>00092     <span class="keywordtype">void</span> turn(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n);
<a name="l00093"></a>00093 
<a name="l00103"></a>00103     iterator push_back(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n, <a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e);
<a name="l00104"></a>00104 
<a name="l00114"></a>00114     iterator push_front(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n, <a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e);
<a name="l00115"></a>00115 
<a name="l00122"></a>00122     <span class="keywordtype">void</span> insert_selfloop (<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e);
<a name="l00123"></a>00123 
<a name="l00133"></a>00133     iterator&amp; pos (<a class="code" href="a00020.html" title="A node in a graph.">node</a>, <a class="code" href="a00010.html" title="An edge in a graph.">edge</a>);
<a name="l00134"></a>00134 <span class="keyword">public</span>:
<a name="l00143"></a><a class="code" href="a00022.html#151a1e7cf6cfbbd0a09c467ec8bc61d1">00143</a>     <a class="code" href="a00027.html" title="List which can be reversed in .">adj_list</a>&amp; adjacency(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n)
<a name="l00144"></a>00144     {
<a name="l00145"></a>00145         <span class="keywordflow">return</span> adj[n];
<a name="l00146"></a>00146     }
<a name="l00147"></a>00147 
<a name="l00156"></a><a class="code" href="a00022.html#cff04f2f8fdd718697ac4c92bab4aea0">00156</a>     <span class="keyword">const</span> <a class="code" href="a00027.html" title="List which can be reversed in .">adj_list</a>&amp; adjacency(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n)<span class="keyword"> const</span>
<a name="l00157"></a>00157 <span class="keyword">    </span>{
<a name="l00158"></a>00158         <span class="keywordflow">return</span> adj[n];
<a name="l00159"></a>00159     }
<a name="l00160"></a>00160 
<a name="l00169"></a><a class="code" href="a00022.html#c0b41dd43adb80ed898b597e791230d8">00169</a>     iterator adj_edges_begin(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n)
<a name="l00170"></a>00170     {
<a name="l00171"></a>00171         <span class="keywordflow">return</span> adj[n].begin();
<a name="l00172"></a>00172     } 
<a name="l00173"></a>00173 
<a name="l00182"></a><a class="code" href="a00022.html#1345ee93995019d81cc78fb2806acc88">00182</a>     iterator adj_edges_end(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n)
<a name="l00183"></a>00183     {
<a name="l00184"></a>00184         <span class="keywordflow">return</span> adj[n].end();
<a name="l00185"></a>00185     }
<a name="l00186"></a>00186 
<a name="l00197"></a>00197     <a class="code" href="a00010.html" title="An edge in a graph.">edge</a> cyclic_next(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n, <a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e);
<a name="l00198"></a>00198 
<a name="l00209"></a>00209     <a class="code" href="a00010.html" title="An edge in a graph.">edge</a> cyclic_prev(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n, <a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e);
<a name="l00210"></a>00210 
<a name="l00211"></a>00211 
<a name="l00220"></a>00220     <span class="keywordtype">void</span> write_st(ostream&amp; os, <a class="code" href="a00026.html" title="ST-number algorithm.">st_number</a>&amp; st);
<a name="l00221"></a>00221 
<a name="l00229"></a><a class="code" href="a00022.html#b04859be18352bc53a120b0676a499ba">00229</a>     list&lt;edge&gt;&amp; selfloops()
<a name="l00230"></a>00230     {
<a name="l00231"></a>00231         <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00232"></a>00232     }
<a name="l00233"></a>00233 
<a name="l00241"></a><a class="code" href="a00022.html#5bda41957054aed983245e28044f7eac">00241</a>     <span class="keyword">const</span> list&lt;edge&gt;&amp; selfloops()<span class="keyword"> const</span>
<a name="l00242"></a>00242 <span class="keyword">    </span>{
<a name="l00243"></a>00243         <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00244"></a>00244     }
<a name="l00245"></a>00245 
<a name="l00256"></a><a class="code" href="a00022.html#fb50ef8f3b5b2c6690b9d364db21f36f">00256</a>     list&lt;edge&gt;&amp; multiple_edges()
<a name="l00257"></a>00257     {
<a name="l00258"></a>00258         <span class="keywordflow">return</span> multi;
<a name="l00259"></a>00259     }
<a name="l00260"></a>00260 
<a name="l00271"></a><a class="code" href="a00022.html#47dedbda766cf0769f98e6ae63ef3152">00271</a>     <span class="keyword">const</span> list&lt;edge&gt;&amp; multiple_edges()<span class="keyword"> const</span>
<a name="l00272"></a>00272 <span class="keyword">    </span>{
<a name="l00273"></a>00273         <span class="keywordflow">return</span> multi;
<a name="l00274"></a>00274     }
<a name="l00275"></a>00275 
<a name="l00286"></a>00286     <span class="keywordtype">bool</span> check();
<a name="l00287"></a>00287 
<a name="l00291"></a>00291     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00023.html" title="Tests if a graph can be drawn on a plane without any edge crossings.">planarity</a>;
<a name="l00292"></a>00292 
<a name="l00296"></a>00296     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00024.html" title="PQ-Trees.">pq_tree</a>;
<a name="l00297"></a>00297 
<a name="l00301"></a>00301     GTL_EXTERN <span class="keyword">friend</span> ostream&amp; operator&lt;&lt; (ostream&amp;, <a class="code" href="a00022.html" title="Ordered adjacency lists as a result of planarity testing.">planar_embedding</a>&amp;);
<a name="l00302"></a>00302 <span class="keyword">private</span>:
<a name="l00307"></a>00307     <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>* G;
<a name="l00308"></a>00308 
<a name="l00313"></a>00313     <a class="code" href="a00021.html" title="A specialized map with nodes as keys.">node_map&lt;adj_list&gt;</a> adj;
<a name="l00314"></a>00314 
<a name="l00319"></a>00319     <a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map&lt;adj_list::iterator&gt;</a> s_pos;
<a name="l00320"></a>00320 
<a name="l00325"></a>00325     <a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map&lt;adj_list::iterator&gt;</a> t_pos;
<a name="l00326"></a>00326 
<a name="l00331"></a>00331     list&lt;edge&gt; <span class="keyword">self</span>;
<a name="l00332"></a>00332 
<a name="l00337"></a>00337     list&lt;edge&gt; multi;
<a name="l00338"></a>00338 };
<a name="l00339"></a>00339 
<a name="l00340"></a>00340 
<a name="l00341"></a>00341 <span class="comment">// class face</span>
<a name="l00342"></a>00342 <span class="comment">// {    </span>
<a name="l00343"></a>00343 <span class="comment">// public:</span>
<a name="l00344"></a>00344 <span class="comment">//     face (planar_embedding&amp; em, node n, edge e) : embed (em),</span>
<a name="l00345"></a>00345 <span class="comment">//      start (n), first (e) { }</span>
<a name="l00346"></a>00346 <span class="comment">//     virtual ~face () { }</span>
<a name="l00347"></a>00347 
<a name="l00348"></a>00348 <span class="comment">// private:    </span>
<a name="l00349"></a>00349 <span class="comment">//     planar_embedding&amp; embed;</span>
<a name="l00350"></a>00350 <span class="comment">//     node start;</span>
<a name="l00351"></a>00351 <span class="comment">//     edge first;</span>
<a name="l00352"></a>00352 
<a name="l00353"></a>00353 <span class="comment">//     friend class planar_embedding;</span>
<a name="l00354"></a>00354 <span class="comment">// };</span>
<a name="l00355"></a>00355 
<a name="l00356"></a>00356 <span class="comment">// struct _face_iterator</span>
<a name="l00357"></a>00357 <span class="comment">// {</span>
<a name="l00358"></a>00358 
<a name="l00359"></a>00359 
<a name="l00360"></a>00360 <span class="comment">//     face&amp; _face;</span>
<a name="l00361"></a>00361 <span class="comment">// };</span>
<a name="l00362"></a>00362 
<a name="l00363"></a>00363 __GTL_END_NAMESPACE
<a name="l00364"></a>00364 
<a name="l00365"></a>00365 <span class="preprocessor">#endif</span>
<a name="l00366"></a>00366 <span class="preprocessor"></span>
<a name="l00367"></a>00367 <span class="comment">//--------------------------------------------------------------------------</span>
<a name="l00368"></a>00368 <span class="comment">//   end of file</span>
<a name="l00369"></a>00369 <span class="comment">//--------------------------------------------------------------------------</span>
</pre></div>    <p class="links">
      <a href="http://www.uni-passau.de/">University of Passau</a>
      &nbsp;-&nbsp;
      <a href="http://www.fmi.uni-passau.de/">FMI</a>
      &nbsp;-&nbsp;
      <a href="http://www.fmi.uni-passau.de/fmi/lehrstuehle/brandenburg/">Theoretical
	Computer Science</a>
    </p>
  <div class="copyright">
      Design &copy; 2002, 2003 <a href="mailto:raitner@fmi.uni-passau.de">Marcus Raitner</a>,  University of Passau 
  </div>
</body>
</html>
